package com.guchenbo.example.io;

import java.io.ByteArrayInputStream;

/**
 * Created by CreGu on 2016/6/13.
 */
public class TestByteArrayInputStream {
    private static final int LEN = 5;
    // 对应英文字母“abcddefghijklmnopqrsttuvwxyz”
    private static final byte[] letters = {
            0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
            0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A
    };

    public static void main(String[] args) {
        ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(letters);
        while (byteArrayInputStream.available() > 0) {
            int i = byteArrayInputStream.read();
            System.out.println(i);
        }
    }
}
